import axios from "axios";
const CheckOrgLoginState = async (loginOrg) => {
    if (loginOrg == null || loginOrg == "") {
        console.log("js-CheckOrgLoginState---未登入,或登入状态已失效");
        return {
            state: "-1",
            message: '未登入,或登入状态已失效!'
        }
    }else{
        const email = loginOrg.email;
        const password = loginOrg.password;
        const resp = await axios.post("http://localhost:8080/keepOrgLogin", { "email": email, 'password': password });
        console.log("验证码机构保持登入",resp);
        if (resp.data.state == '3') {
            return {
                state:"3",
                message:resp.data.message
            }
        }

        if (resp.data.state == '0') {
            return {
                state:"0",
                loginOrg:resp.data.loginOrg
            }
        }
    }
}
export default CheckOrgLoginState